class Bookstore {
    private Book[] books;
    private int count;

    public Bookstore(int size) {
        books = new Book[size];
        count = 0;
    }

    public void addBook(Book book) {
        if (count < books.length) {
            books[count++] = book;
        } else {
            System.out.println("书店库存已满，无法添加书籍");
        }
    }

    public void printAllBooks() {
        double totalPrice = 0;
        for (int i = 0; i < count; i++) {
            System.out.println(books[i].toString());
            totalPrice += books[i].getPrice();
        }
        System.out.println("所有书籍总价格：" + totalPrice + "元");
    }
}